<template>
	<view class="container" v-if="isShow">
		<view class="list-cell m-t b-b" @click="navTo('/pageA/makemode/bank')" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">银行卡</text>
			<text class="cell-more yticon icon-you"></text>
		</view>
		<!-- <view class="list-cell m-t b-b" @click="navTo('/pageA/makemode/wxImg')" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">微信二维码</text>
			<text class="cell-more yticon icon-you"></text>
		</view> -->
		<view class="list-cell m-t b-b" @click="navTo('/pageA/makemode/zfbImg')" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">支付宝</text>
			<text class="cell-more yticon icon-you"></text>
		</view>
	</view>
</template>

<script>
	import {
		mapMutations
	} from 'vuex';
	export default {
		data() {
			return {
				userInfo: [],
				isShow:false
			};
		},
		async onLoad() {
			const response = await this.$fun.ajax.post('index/passSet', {})
			this.isShow = response.data
		},
		onShow() {
			this.userInfo = uni.getStorageSync('userDetail')
		},
		methods: {
			...mapMutations(['logout']),

			navTo(url) {
				if (url == 'wx') {
					location.href = this.$wxLogin
				}
				uni.navigateTo({
					url
				})
			},
			//退出登录
			toLogout() {
				uni.showModal({
					content: '确定要退出登录么',
					success: (e) => {
						if (e.confirm) {
							this.$api.user_logout().then(res => {
								if (res.code == 1) {
									this.$fun.msg(res.msg)
									uni.clearStorage()
									setTimeout(() => {
										uni.navigateBack();
									}, 200)
								}
							})

						}
					}
				});
			},
			//switch
			switchChange(e) {
				let statusTip = e.detail.value ? '打开' : '关闭';
				this.$api.msg(`${statusTip}消息推送`);
			},

		}
	}
</script>

<style lang='scss'>
	page {
		background: $page-color-base;
	}

	.list-cell {
		display: flex;
		align-items: baseline;
		padding: 20upx 34upx;
		line-height: 60upx;
		position: relative;
		background: #fff;
		justify-content: center;

		&.log-out-btn {
			margin-top: 40upx;

			.cell-tit {
				color: $uni-color-primary;
				text-align: center;
				margin-right: 0;
			}
		}

		&.cell-hover {
			background: #fafafa;
		}

		&.b-b:after {
			left: 30upx;
		}

		&.m-t {
			margin-top: 16upx;
		}

		.cell-more {
			align-self: baseline;
			font-size: $font-lg;
			/* color: $font-color-light; */
			margin-left: 10upx;
		}

		.cell-tit {
			flex: 1;
			font-size: $font-base + 2upx;
			color: $font-color-dark;
			margin-right: 10upx;
		}

		.cell-tip {
			font-size: $font-base;
			/* color: $font-color-light; */
		}

		switch {
			transform: translateX(16upx) scale(.84);
		}
	}
</style>
